﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO;
using System.Data;

namespace Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO
{
    class UserVOHDNhap
    {
        private int _MaHDNhap;
        private int _MaNV;
        private DateTime _NgayLap;

        public UserVOHDNhap(int MaHDNhap, int MaNV, DateTime Ngaylap)
        {
            this._MaHDNhap = MaHDNhap;
            this._MaNV = MaNV;
            this._NgayLap = Ngaylap;          
        }

        public int MAHOADONNHAP
        {
            get { return _MaHDNhap; }
            set { _MaHDNhap = value; }
        }

        public int MANV
        {
            get { return _MaNV; }
            set { _MaNV = value; }
        }

        public DateTime NGAYLAP
        {
            get { return _NgayLap; }
            set { _NgayLap = value; }
        }

        public void CreateFormCTHD(DataRow dr)
        {
            if (dr != null)
            {
                this._MaHDNhap = dr.IsNull(0) ? 0 : Convert.ToInt32(dr[0]);
                this._MaNV = dr.IsNull(1) ? 0 : Convert.ToInt32(dr[1]);
                this._NgayLap = dr.IsNull(2) ? DateTime.Now : Convert.ToDateTime(dr[2]);           
            }
        }
    }
}
